class Service < ActiveRecord::Base
	
	KINDS = [['По умолчанию', :default],
					 ['Светлее', :light],
					 ['Светлее без меню', :light_menu]]
	
	acts_as_enum :color, [:default, :light, :light_menu]
	
	named_scope :visible, :conditions => { :is_static => false, :is_right => false }, :order => "created_at ASC"
	named_scope :unvisible, :conditions => { :is_static => true, :is_right => false }, :order => "created_at DESC"
	named_scope :right, :conditions => { :is_right => true }, :order => "created_at ASC"

  protected
  
    def validate
      errors.add("Имя", "не может быть пустым") if name.nil? || name == ''
      errors.add("Описание", "не может быть пустым") if description.nil? || description == ''
    end

end
